<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>发票管理</title>
<script src="${ctxStatic }/jquery/jquery-1.8.3.min.js"></script>
<link rel="stylesheet" href="${ctxStatic }/gov/css/gov-invoice.css" />

<script src="${ctxStatic }/xiake/js/slider.js"></script>
<script src="${ctxStatic }/xiake/js/jquery.reveal.js"></script>
<script src="${ctxStatic }/xiake/js/switch.js"></script>
<script>
	//计算开票金额
	function JSfpmoney()
	{
		var allmoney=0;
		/* var a=0;//超时长
		var b=0;//超公里
		var c=0;//司机食宿
		var d=0;//三者相加 */
		$(".fp_list table tr td").find("input").each(function(){
			var ck=$(this).attr("checked");
			if(ck=="checked")
			{
				$("#outtimefee").val(0);
				$("#outkmsfee").val(0);
				$("#dirverfee").val(0);
				 var a=$(this).parent().parent().find(".fp").find(".xs1").val();
				 var b=$(this).parent().parent().find(".fp").find(".xs2").val();
				 var c=$(this).parent().parent().find(".fp").find(".xs3").val();
				 if(isNaN(a)||a==''){
					a= 0; 
				 }
				 if(isNaN(b)||b==''){
					b= 0;
				 }
				 if(isNaN(c)||c==''){
					c= 0; 
				 }
				 var d = parseFloat(a)+parseFloat(b)+parseFloat(c);
				var v=$(this).parent().parent().find(".fpmoney").html();
				var sum = 0;
				if(d==''||isNaN(d) ){
					sum = parseFloat(v);
				}else{
					$("#outtimefee").val(a);
					$("#outkmsfee").val(b);
					$("#dirverfee").val(c);
					sum = parseFloat(v)+parseFloat(d);
				}
				allmoney+=sum;
			}
		});
		$(".labelmoney").html(allmoney);
		$("#money").val(allmoney);
	}
	function check() {
		if($("#money").val()==''||$("#money").val==null){
			alert("请至少选择一个订单");
			return false;
		}else{
			$('#inputForm').submit();
		}
	}
</script>
</head>
<body>
		 <%@include file="../index/head.jsp" %>
	<div id="invoice_h">
			 <div class="invoice_main">
			 	  <div class="invoice_lists">
			 	  	   <div class="invoice_top clearfix">
			 	  	   	     <h5 class="invoice_tit">
			 	  	   	         <span>可开发票列表</span>			 	  	   	         
			 	  	   	         <a href="${ctxGov}/rcptRecord">开票记录</a>
			 	  	   	         <a href="${ctxGov}/userRcptInfo">开票信息</a>
			 	  	         </h5>
			 	  	         <div class="invoice_m">
			 	  	   	         <span>已选金额：<font class="money_1 labelmoney">0.00</font></span>
			 	  	   	         <a href="javascript:check();" class="query" id="kp">立刻开票</a>
			 	  	         </div>
			 	  	   </div>
			 	  	   <div class="invoice_table">
			 	  	   <div class="check_all fp_list">
			 	  	   <form id="inputForm" action="${ctxGov }/userRcptInfo" method="post">
				             <input type="hidden" name="totalOuttimefee" id="outtimefee">
				             <input type="hidden" name="totalOutkmsfee" id="outkmsfee">
				             <input type="hidden" name="totalRirverfee" id="dirverfee">
				             <input type="hidden" name="money" id="money">
				             <input type="hidden" name="buttonname" value="提交">
			 	  	   	     <table class="in_t_box" cellpadding="0" cellspacing="0">
			 	  	   	     	<tr>
			 	  	   	     		<th>全选</th>
			 	  	   	     		<th>订单号</th>
			 	  	   	     		<th>订单名称</th>
			 	  	   	     		<th>可开票金额</th>
			 	  	   	     		<th>支付时间</th>
			 	  	   	     		<th>超时长费</th>
			 	  	   	     		<th>超公里费</th>
			 	  	   	     		<th>司机食宿费</th>
			 	  	   	     	</tr>
			 	  	   	     	<c:forEach items="${page.list}" var="info">
			 	  	   	     	<tr>
			 	  	   	     		<td>
			 	  	   	     			<input type="checkbox" class="selectChild" value="${info.orderid }" name="rcptIds" onclick="JSfpmoney()">
			 	  	   	     		</td>
			 	  	   	     		<td>${info.orderid}</td>
			 	  	   	     		<td>${info.ordername}</td>
			 	  	   	     		<td class="fpmoney">${info.dueamount}</td>
			 	  	   	     		<td class="fp"><fmt:formatDate value="${info.paydate}" pattern="yyyy-MM-dd" /></td>
			 	  	   	     		<td class="fp">
			 	  	   	     			<input type="number" placeholder="请填写" class="overtime_1 xs1" min="0" name="outtimefee"></td>
			 	  	   	     		</td >
			 	  	   	     		<td class="fp">
			 	  	   	     			<input type="number" placeholder="请填写" class="overtime_1 xs2" min="0" name="outkmsfee"></td>
			 	  	   	     		</td>
			 	  	   	     		<td class="fp">
			 	  	   	     			<input type="number" placeholder="请填写" class="overtime_1 xs3" min="0" name="dirverfee"></td>
			 	  	   	     		</td>
			 	  	   	     	</tr>
			 	  	   	     	</c:forEach>
			 	  	   	     </table>
			 	  	   	     </form>
			 	  	   	     </div>
			 	  	   </div>
                     <div class="invoice_egras">
                     	 <h5>开票规则：</h5>
                     	 <p>1.开票内容仅支持代办租车费，发票类型仅支持增值税普通发票。</p>
                     	 <p>2.支持线下收费开票，司机食宿、超公里费、超时费均可开票。</p>
                     	 <p>3.单次申请开票满1000元包邮，不满1000元邮费到付，暂不支持港澳台包邮。</p>
                     	 <p>4.开具发票需提供：发票抬头、纳税人识别号（企业必填）、收件人及电话、邮寄地址、邮编。</p>
                     	 <p>5.增值税普通发票我们将在3-7个工作日寄出。</p>
                     	 <p>6.因个人原因导致发票退回重开，所产生的往返快递费用将由您自行承担。</p>
                     </div>
			 	  </div>
			 </div>
		</div>
		 <%@include file="../index/foot.jsp" %>
	</body>
 </html>